<template>
  <div class="dashboard-container">
    <el-card>
      <el-tabs v-model="activeName">
        <el-tab-pane label="角色管理" name="first">
          <el-button type="primary" size="small" class="el-icon-plus">新增角色</el-button>
          <el-table :data="roleList" style="width: 100%" border>
            <el-table-column prop="companyId" label="序号" width="180"></el-table-column>
            <el-table-column prop="name" label="角色名" width="180" sortable></el-table-column>
            <el-table-column prop="description" label="描述" sortable></el-table-column>
            <el-table-column label="操作">
              <el-button type="text" size="small">分配权限</el-button>
              <el-button type="text" size="small">修改</el-button>
              <el-button type="text" size="small">删除</el-button>
            </el-table-column>
          </el-table>
          <el-pagination :current-page="currentPage4" layout="total, prev, pager, next" :total="5"></el-pagination>
        </el-tab-pane>
        <el-tab-pane label="公司信息" name="second">公司信息</el-tab-pane>
      </el-tabs>
    </el-card>
  </div>
</template>

<script>
import { mapState, mapActions } from "vuex";
export default {
  data() {
    return {
      activeName: "first",
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄"
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄"
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄"
        }
      ],
      currentPage4: 4
    };
  },

  mounted() {
    this.updateRoleList();
  },

  methods: {
    ...mapActions("roles", ["updateRoleList"])
  },
  computed: {
    ...mapState("roles", ["roleList"])
  }
};
</script>

<style lang="less" scoped>
::v-deep .el-tabs {
  .el-tabs__item {
    width: 120px;
    height: 60px;
    line-height: 60px;
    font-size: 18px;
  }
  .el-tabs__content {
    margin-top: 40px;
    .el-table {
      margin-top: 20px;
    }
  }
}
</style>